package com.yi.mall.demo.controller;

import com.yi.mall.common.utils.ResponseEnum;
import com.yi.mall.common.utils.Result;
import com.yi.mall.demo.pojo.UserInfo;
import com.yi.mall.demo.service.IUserUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
import java.util.List;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {
    @Autowired
    private IUserUserInfoService userUserInfoService;
    @GetMapping("/getuserInfo")
    public Result<UserInfo> getuserInfo(Long id) {
        UserInfo userInfo= userUserInfoService.getById(id);
        return Result.success(ResponseEnum.SUCCESS, userInfo);
    }
    @GetMapping("/getalluserInfo")
    public Result<List> getuserInfo() {
        List<UserInfo> list = userUserInfoService.list();
        return Result.success(ResponseEnum.SUCCESS, list);
    }

}
